﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace Chenxin.Lib.Business.BLL
{
    /// <summary>
    ///t_Contract_Finance_BillPrintInfo 的摘要说明
    /// </summary>
    public class t_Contract_Finance_BillPrintInfo
    {
        public t_Contract_Finance_BillPrintInfo()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        //private readonly Chenxin.Lib.Business.Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.t_Contract_Finance_BillPrintInfo Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo = new Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo();

        #region  成员方法
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo model)
        {
            Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.Add(model);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo GetModel(Guid RecordId)
        {

            return Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.GetModel(RecordId);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            return Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.GetList(strWhere);
        }
        
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo> GetModelList(string strWhere)
        {
            DataSet ds = Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo> DataTableToList(DataTable dt)
        {
            List<Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo> modelList = new List<Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Chenxin.Lib.Business.Entity.t_Contract_Finance_BillPrintInfo();
                    if (dt.Rows[n]["RecordId"].ToString() != "")
                    {
                        model.RecordId = new Guid(dt.Rows[n]["RecordId"].ToString());
                    }
                    if (dt.Rows[n]["BillId"].ToString() != "")
                    {
                        model.BillId = new Guid(dt.Rows[n]["BillId"].ToString());
                    }
                    if (dt.Rows[n]["PrintTime"].ToString() != "")
                    {
                        model.PrintTime = DateTime.Parse(dt.Rows[n]["PrintTime"].ToString());
                    }
                    if (dt.Rows[n]["PrintEmployeeId"].ToString() != "")
                    {
                        model.PrintEmployeeId = new Guid(dt.Rows[n]["PrintEmployeeId"].ToString());
                    }
                    model.PrintEmployee = dt.Rows[n]["PrintEmployee"].ToString();
                    if (dt.Rows[n]["PrintDepartId"].ToString() != "")
                    {
                        model.PrintDepartId = new Guid(dt.Rows[n]["PrintDepartId"].ToString());
                    }
                    model.PrintDepart = dt.Rows[n]["PrintDepart"].ToString();
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return Chenxin.Lib.Business.DAL.t_Contract_Finance_BillPrintInfo.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}